/*
  typescript 语言帮助类
 */

import * as lo from 'lodash';
import {TsReflect} from "./TsReflect";
export const _ = lo;


export class TsBase{

    private static __initMethods:Array<any>;

    static __init(method?: (ins:any)=>void){
        this.__initMethods = this.__initMethods || [];
        this.__initMethods.push(method);
    }
    protected __init(){
        const self =this;
        const clazz = TsReflect.getClass<typeof TsBase>(self); //继承后的那个类， 不是 TsBase
        const methods = clazz.__initMethods || [];
        methods.forEach((method)=>{
            method(self);
        })
    }
}


